<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>找回密码</title>
    <style>
        .nav{
            background-color: #00F7DE;
            background-size: cover;
            width: auto;
            height: 40px;
            margin: 20px;
            overflow: hidden;
            zoom: 1;
            font-size: 20px;
        }
    </style>
</head>
<body>
<ul class="nav">
    <li>安全处理中心</li>
</ul>
<body background="img/bg1.jpg" style="background-size: 100%,100%"></body>
<div class="content">
    <div class="web-width">
        <div class="for-liucheng">
            <div class="liulist for-cur"></div>
            <div class="liulist"></div>
            <div class="liulist"></div>
            <div class="liulist"></div>
            <div class="liutextbox">
                <div class="liutext for-cur"><em>1</em><br/>
                    <strong>填写账户名</strong></div>
                <div class="liutext"><em>2</em><br/>
                    <strong>验证身份</strong></div>
                <div class="liutext"><em>3</em><br/>
                    <strong>设置新密码</strong></div>
                <div class="liutext"><em>4</em><br/>
                    <strong>完成</strong></div>
            </div>
        </div>

        <div style="height: auto;background-color: rgba(255,255,255,0)" action="#" method="post" class="forget-pwd">
            <dl>
                <dt>账号/手机号：</dt>
                <dd>
                    <input type="text"/>
                </dd>
                <div class="clears"></div>
            </dl>
            <input type="text" name="text" value="" placeholder="验证码"
                   style="height:34px; width: 190px;position: relative; top:-15px;border: none;
                   border: 1px solid; font-size:15px;"id ="">
            <canvas id="canvas" width="100" height="43" onclick="dj()"
                    style="border: 1px solid #ccc;
                    border-radius: 5px;"></canvas><br><br><br><br>
            <input type="text" value="">
            <a  style="font-size: 17px" href="./RetrievePassword1.html">下一步</a>

        </div>
    </div>
</div>
<style type="text/css">
    .clears {
        clear: both
    }

    .for-liucheng {
        width: 640px;
        margin: 30px auto;
        height: 50px;
        padding: 20px 0 0 0;
        position: relative
    }

    .liulist {
        float: left;
        width: 25%;
        height: 7px;
        background: #ccc
    }

    .liutextbox {
        position: absolute;
        width: 100%;
        left: 0;
        top: 10px
    }

    .liutextbox .liutext {
        float: left;
        width: 25%;
        text-align: center
    }

    .liutextbox .liutext em {
        display: inline-block;
        width: 24px;
        height: 24px;
        -moz-border-radius: 24px;
        -webkit-border-radius: 24px;
        border-radius: 24px;
        background: #ccc;
        text-align: center;
        font-size: 14px;
        line-height: 24px;
        font-style: normal;
        font-weight: bold;
        color: #fff
    }

    .liutextbox .liutext strong {
        display: inline-block;
        height: 26px;
        line-height: 26px;
        font-weight: 400
    }

    .liulist.for-cur {
        background: #77b852
    }

    .liutextbox .for-cur em {
        background: #77b852
    }

    .liutextbox .for-cur strong {
        color: #77b852
    }

    .forget-pwd {
        width: 500px;
        margin: 20px auto;
        min-height: 400px
    }

    .forget-pwd input, .forget-pwd select, .forget-pwd button {
        border: 0;
        margin: 0;
        padding: 0;
        background: 0
    }

    .forget-pwd dl {
        margin-bottom: 20px
    }

    .forget-pwd dt {
        float: left;
        padding-right: 10px;
        width: 100px;
        height: 30px;
        line-height: 30px;
        text-align: right;
        font-size: 14px
    }

    .forget-pwd dd {
        float: left;
        width: 380px;
        height: 30px;
        position: relative
    }

    .forget-pwd dd input {
        width: 190px;
        height: 28px;
        border: #ccc 1px solid
    }

    .forget-pwd dd select {
        width: 190px;
        height: 30px;
        border: #ccc 1px solid
    }

    .forget-pwd dd button {
        width: 120px;
        height: 30px;
        line-height: 30px;
        border: #ddd 1px solid;
        background: #f1f1f1;
        text-align: center;
        cursor: pointer;
        font-size: 14px;
        color: #666
    }

    .forget-pwd .yanzma {
        position: absolute;
        left: 200px;
        top: 2px;
        height: 30px;
        line-height: 30px;
        width: 180px
    }

    .subtijiao {
        padding: 0 0 0 110px
    }

    .subtijiao input {
        width: 85px;
        height: 32px;
        background: #f60;
        color: #fff;
        font-size: 14px;
        cursor: pointer
    }

    .successs {
        text-align: center;
        padding: 20px 0 60px 0
    }

    .successs h3 {
        padding: 20px;
        font-size: 25px;
        color: #a0cd4e
    }
</style>
<style>
    html,body,div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video, select {
        margin: 0;
        padding: 0;
        border: 0;
    }

    table {
        border-collapse: collapse;
    }

    body {
        font-size: 12px;
        color: #333;
        font-family: "Microsoft Yahei";
        overflow-x: hidden;
        background: #f7f7f7;
        background: url("img/bg1.jpg");
    }

    .bodybg {
        background: url(..) right 160px no-repeat;
    }

    img, a {
        border: 0;
        text-decoration: none;
    }

    ol, ul {
        list-style: none;
    }

    a {
        color: #333;
        -webkit-transition: all .3s ease-out;
        -moz-transition: all .3s ease-out;
        transition: all .3s ease-out;
    }

    a:hover {
        color: #005b9e;
        -webkit-transition: all .3s ease-out;
        -moz-transition: all .3s ease-out;
        transition: all .3s ease-out;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    .web-width {
        width: 1200px;
        margin: 0 auto;
    }

    .fl {
        float: left;
    }

    .fr {
        float: right;
    }
</style>
</body>
<script>
    var show_num = [];
    draw(show_num);
    function dj(){
        draw(show_num);
    }
    function sublim(){
        var val=document.getElementById("text").value;
        var num = show_num.join("");
        if(val==''){
            alert('请输入验证码！');
        }else if(val == num){
            alert('提交成功！');
            document.getElementById(".input-val").val('');
            draw(show_num);

        }else{
            alert('验证码错误！');
            document.getElementById("text").value='';
            draw(show_num);
        }



    }
    function draw(show_num) {
        var canvas_width=document.getElementById('canvas').clientWidth;
        var canvas_height=document.getElementById('canvas').clientHeight;
        var canvas = document.getElementById("canvas");//获取到canvas的对象，演员
        var context = canvas.getContext("2d");//获取到canvas画图的环境，演员表演的舞台
        canvas.width = canvas_width;
        canvas.height = canvas_height;
        var sCode = "A,B,C,E,F,G,H,J,K,L,M,N,P,Q,R,S,T,W,X,Y,Z,1,2,3,4,5,6,7,8,9,0,q,w,e,r,t,y,u,i,o,p,a,s,d,f,g,h,j,k,l,z,x,c,v,b,n,m";
        var aCode = sCode.split(",");
        var aLength = aCode.length;//获取到数组的长度

        for (var i = 0; i <= 3; i++) {
            var j = Math.floor(Math.random() * aLength);//获取到随机的索引值
            var deg = Math.random() * 30 * Math.PI / 180;//产生0~30之间的随机弧度
            var txt = aCode[j];//得到随机的一个内容
            show_num[i] = txt;
            var x = 10 + i * 20;//文字在canvas上的x坐标
            var y = 20 + Math.random() * 8;//文字在canvas上的y坐标
            context.font = "bold 23px 微软雅黑";

            context.translate(x, y);
            context.rotate(deg);

            context.fillStyle = randomColor();
            context.fillText(txt, 0, 0);

            context.rotate(-deg);
            context.translate(-x, -y);
        }
        for (var i = 0; i <= 5; i++) { //验证码上显示线条
            context.strokeStyle = randomColor();
            context.beginPath();
            context.moveTo(Math.random() * canvas_width, Math.random() * canvas_height);
            context.lineTo(Math.random() * canvas_width, Math.random() * canvas_height);
            context.stroke();
        }
        for (var i = 0; i <= 30; i++) { //验证码上显示小点
            context.strokeStyle = randomColor();
            context.beginPath();
            var x = Math.random() * canvas_width;
            var y = Math.random() * canvas_height;
            context.moveTo(x, y);
            context.lineTo(x + 1, y + 1);
            context.stroke();
        }
    }
    function randomColor() {//得到随机的颜色值
        var r = Math.floor(Math.random() * 256);
        var g = Math.floor(Math.random() * 256);
        var b = Math.floor(Math.random() * 256);
        return "rgb(" + r + "," + g + "," + b + ")";
    }
</script>
</html>
